import request from "../utils/request";

//发布评论
export async function issue (data,param) {
  return await request({
    url: '/comment',
    method: 'post',
    data:data,
    headers: {
      'Content-Type': 'application/json',
      'token': param.token 
    }
  })
}

//回复评论
export async function reply (data,param) {
  return await request({
    url: '/comment/reply',
    method: 'post',
    data:data,
    headers: {
      'Content-Type': 'application/json',
      'token': param.token 
    }
  })
}

//查询评论
export async function list (param) {
  return await request({
    url: '/comment/'+param.current+'/'+param.size+'/'+param.rid,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
      'token': param.token 
    }
  })
}

//查询评论的回复
export async function listReply (param) {
  return await request({
    url: '/comment/'+param.rid+'/'+param.id,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
      'token': param.token 
    }
  })
}

//查询评论总数
export async function count (param) {
  return await request({
    url: '/comment/'+param.rid,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
      'token': param.token 
    }
  })
}
